package com.wantdo.web;

import com.wantdo.entity.User;
import com.wantdo.entity.UserExample;
import com.wantdo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by king on 2017/10/13.
 */
@Controller
public class UserControl {

	@Autowired
	private UserMapper userMapper;

	@ResponseBody
	@RequestMapping("/user/list")
	public Object userList(){
		List<User> users = userMapper.selectByExample(new UserExample());
//		System.out.println( JsonMapper.toJsonString(users));
		return users;
	}

}
